/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitas;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author Muhammad Fachrurrozy
 */
@Entity

public class RequestBuku implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer idRequestBuku;
    private String judulBuku;
    private String pengarang;
    
    
    @ManyToOne
    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Integer getIdRequestBuku() {
        return idRequestBuku;
    }

    public void setIdRequestBuku(Integer id) {
        this.idRequestBuku = id;
    }

    public String getJudulBuku() {
        return judulBuku;
    }

    public void setJudulBuku(String judulBuku) {
        this.judulBuku = judulBuku;
    }

    public String getPengarang() {
        return pengarang;
    }

    public void setPengarang(String pengarang) {
        this.pengarang = pengarang;
    }



    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRequestBuku != null ? idRequestBuku.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RequestBuku)) {
            return false;
        }
        RequestBuku other = (RequestBuku) object;
        if ((this.idRequestBuku == null && other.idRequestBuku != null) || (this.idRequestBuku != null && !this.idRequestBuku.equals(other.idRequestBuku))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitas.RequestBuku[id=" + idRequestBuku + "]";
    }

}
